package kr.co.ljw.refactoring;

public class Rental {
	private Movie	_movie;
	private int		_dayRented;
	
	public Rental(Movie movie, int dayRented){
		_movie = movie;
		_dayRented = dayRented;
	}
	
	public Movie getMovie() {
		return _movie;
	}
	
	public int getDayRented() {
		return _dayRented;
	}

	public double getCharge(){
		return _movie.getCharge(_dayRented);
	}

	//포인트(frequent renter points) 추가
	public int getFrequentRenterPoints() {
		 //최신(new release)을 이틀 이상 대여하는 경우추가 포인트 제공
		 if((getMovie().getPriceCode() == Movie.NEW_RELEASE) && getDayRented() > 1 )
			 return 2;
		 else
			 return 1;
	}	
}